<template>
	<div>
		右侧
		<button @click="info('right')">info</button>
		<button @click="success('right')">success</button>
		<button @click="warning('right')">warning</button>
		<button @click="error('right')">error</button>
		<br/>
		中央
		<button @click="info('center')">info</button>
		<button @click="success('center')">success</button>
		<button @click="warning('center')">warning</button>
		<button @click="error('center')">error</button>
		<br/>
		左侧
		<button @click="info('left')">info</button>
		<button @click="success('left')">success</button>
		<button @click="warning('left')">warning</button>
		<button @click="error('left')">error</button>
		<br/>
		只有标题
		<button @click="info('right','')">info</button>
		<button @click="success('right','')">success</button>
		<button @click="warning('right','')">warning</button>
		<button @click="error('right','')">error</button>
		<br/>
		无关闭按钮
		<button @click="info('right','',false)">info</button>
		<button @click="success('right','',false)">success</button>
		<button @click="warning('right','',false)">warning</button>
		<button @click="error('right','',false)">error</button>
		<br/>
		<button @click="test">程序关闭</button>
	</div>
</template>

<script>
import Notice from '@/components/pc/notice';

window.Notice=Notice;
export default {
	name:'index',
	components:{
	},
	data(){
		return {
		};
	},
	methods:{
		info(position='right',hasBody=true,closeable=true){
			Notice.info({
				title:'标题标题标题标题标题标题标题标题标题标题',
				content:hasBody&&'内容内容内\n	容内容内容内容内容内容内容内容内容内容内容内容内容内容内容',
				duration:closeable?0:2,
				position,
				closeable,
			}).then(() => {
				console.log('关闭info');
			});
		},
		success(position='right',hasBody=true,closeable=true){
			Notice.success({
				title:'标题标题标题标题标题标题标题标题标题标题',
				content:hasBody&&'内容内容内\n	容内容内容内容内容内容内容内容内容内容内容内容内容内容内容',
				duration:closeable?0:2,
				position,
				closeable,
			}).then(() => {
				console.log('关闭success');
			});
		},
		warning(position='right',hasBody=true,closeable=true){
			Notice.warning({
				title:'标题标题标题标题标题标题标题标题标题标题',
				content:hasBody&&'内容内容内\n	容内容内容内容内容内容内容内容内容内容内容内容内容内容内容',
				duration:closeable?0:2,
				position,
				closeable,
			}).then(() => {
				console.log('关闭warning');
			});
		},
		error(position='right',hasBody=true,closeable=true){
			Notice.error({
				title:'标题标题标题标题标题标题标题标题标题标题',
				content:hasBody&&'内容内容内\n	容内容内容内容内容内容内容内容内容内容内容内容内容内容内容',
				duration:closeable?0:2,
				position,
				closeable,
			}).then(() => {
				console.log('关闭error');
			});
		},
		test(){
			Notice.info({
				title:'标题标题标题标题标题标题标题标题标题标题',
				duration:0,
			}).close();
		}
	}
};
</script>

<style lang="scss">
</style>
